<!--  -->
<template>
  <div class="order">
    <HeaderTop title="订单"></HeaderTop>
     <div class="shopcart-list">
      <div class="list-content">
        <ul>
          <li class="food" v-for="(item, index) in orders" :key="index">
            <span class="name">{{ item.fname }}</span>
            <div class="price">
              <span>￥{{ item.fprice }}</span>
            </div>
            <div class="count">
              <span>X{{ item.fcount }}</span>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderTop from "../../components/HeaderTop/HeaderTop.vue";
import {reqGetOrders} from "../../api"
export default {
  data() {
    return {
      orders:[]
    };
  },
  mounted() {
    //加载订单列表
    this.getOrders();
  },

  components: {
    HeaderTop,
  },

  computed: {
  },

  methods: {
    async getOrders(){
      const result= await reqGetOrders();
      if(result.code>0){
        this.orders=result.data.result;
        console.log(this.orders);
      }
    }
  },
};
</script>
<style lang='stylus' rel='stylesheet/stylus' scoped>
@import '../../common/stylus/minxns.styl';
.order
 width 100%
 .shopcart-list
      position absolute
      left 0
      top 45px
      width 100%
      .list-content
        padding 0 18px
        padding-bottom 50px
        max-height 1000px
        overflow hidden
        background #fff
        .food
          position relative
          padding 12px 0
          box-sizing border-box
          bottom-border-1px(rgba(7, 17, 27, 0.1))
          .name
            line-height 24px
            font-size 14px
            color rgb(7, 17, 27)
          .price
            position absolute
            right 90px
            bottom 12px
            line-height 24px
            font-size 14px
            font-weight 700
            color rgb(240, 20, 20)
          .count
            position absolute
            right 40px
            bottom 12px
            line-height 24px
            font-size 14px
            font-weight 700
            color rgb(7, 17, 27)      
</style>